﻿#pragma once

// declear class/struct in namespace
#define DECLARE_CLASS_IN_NAMESPACE(class_name, namespace_name)		namespace namespace_name { class class_name;  }
#define DECLARE_STRUCT_IN_NAMESPACE(struct_name, namespace_name)	namespace namespace_name { struct struct_name; }

// define the input .lib file suffix
#ifdef _UNICODE
	#ifdef _DEBUG
		#define MYTEST_LIB_FILE_SUFFIX	"_Debug_Unicode"
	#elif defined MY_BETA
		#define MYTEST_LIB_FILE_SUFFIX	"_Release_Unicode_Beta"
	#else
		#define MYTEST_LIB_FILE_SUFFIX	"_Release_Unicode"
	#endif
#else
	#ifdef _DEBUG
		#define MYTEST_LIB_FILE_SUFFIX	"_Debug"
	#else
		#define MYTEST_LIB_FILE_SUFFIX	"_Release"
	#endif
#endif

#define ARRAY_SIZE(array)			( sizeof(array) / sizeof(array[0]) )
//#define SAFE_DELETE(p)			{ if(p) { delete (p);     (p)=NULL; } }
#define SAFE_ARRAY_DELETE(p)		{ if(p) { delete [] (p);  (p)=NULL; } }
//#define SAFE_RELEASE(p)			{ if(p) { (p)->Release(); (p)=NULL; } }
template <typename type> void safe_delete(type &del) { if(del) { delete del; del=0; } }

#undef max
#undef min
#define my_max(a,b)            (((a) > (b)) ? (a) : (b))
#define my_min(a,b)            (((a) < (b)) ? (a) : (b))
